<template>
  <div :data="businessInfoData">
    <!-- <h3 class="h3title mb20">认证情况</h3> -->
    <TitleContainer spot="认证情况" />
    <el-row :gutter="20">
      <el-col :span="8">
        <div class="item">
          <span class="item-label">渠道来源：</span>
          <span class="item-value">{{ businessInfoData.channel_name }}</span>
        </div>
        <div class="item">
          <span class="item-label">是否身份认证：</span>
          <span class="item-value">{{
            !~~businessInfoData.id_auth ? '否' : '是'
          }}</span>
        </div>
        <!-- <div class="item">
                    <span class="item-label">是否接收营销短信：</span>
                    <span class="item-value"></span>
                </div> -->
      </el-col>
      <el-col :span="8">
        <div class="item">
          <span class="item-label">是否绑卡：</span>
          <span class="item-value">{{
            !~~businessInfoData.bind_card ? '否' : '是'
          }}</span>
        </div>
        <div class="item">
          <span class="item-label">是否人脸识别：</span>
          <span class="item-value">
            {{ !~~businessInfoData.face_atuh ? '否' : '是' }}
          </span>
        </div>
        <!-- <div class="item">
                    <span class="item-label">是否退订营销短：</span>
                    <span class="item-value"></span>
                </div> -->
      </el-col>
      <el-col :span="8">
        <div class="item">
          <span class="item-label">是否白名单：</span>
          <span class="item-value">{{
            !~~businessInfoData.in_white_list ? '否' : '是'
          }}</span>
        </div>
        <div class="item">
          <span class="item-label">提额认证项：</span>
          <span class="item-value">
            <span
              v-for="(item, index) in businessInfoData.trace_type_names"
              :key="index"
              >{{ item }}</span
            >
            <span v-if="~~businessInfoData.trace_count">
              (共{{ businessInfoData.trace_count }}项)
            </span>
          </span>
        </div>
        <!-- <div class="item">
                    <span class="item-label">是否接收逾欠短信：</span>
                    <span class="item-value"></span>
                </div> -->
      </el-col>
    </el-row>
    <!-- <h3 class="h3title">业务情况</h3> -->
    <TitleContainer spot="业务情况" />

    <div class="userInfo-container">
      <div class="row">
        <span class="fl row-label">累计情况</span>
        <div class="row-value">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="item">
                <span class="item-label">授信总金额：</span>
                <span class="item-value"
                  >{{ businessInfoData.quota_amount }}元</span
                >
              </div>
              <div class="item">
                <span class="item-label">贷款余额：</span>
                <span class="item-value"
                  >{{ businessInfoData.loan_balance }}元</span
                >
              </div>
            </el-col>
            <el-col :span="12">
              <div class="item">
                <span class="item-label">贷款总金额：</span>
                <span class="item-value"
                  >{{ businessInfoData.loan_total_amount }}元</span
                >
              </div>
              <div class="item">
                <span class="item-label">额度使用率：</span>
                <span class="item-value"
                  >{{ (businessInfoData.balance_rate * 100).toFixed(2) }}%</span
                >
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="row">
        <span class="fl row-label">首贷</span>
        <div class="row-value">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="item">
                <span class="item-label">首贷日期：</span>
                <span class="item-value">{{
                  businessInfoData.first_loan_date
                }}</span>
              </div>
              <div class="item">
                <span class="item-label">首贷期数：</span>
                <span class="item-value"
                  >{{ businessInfoData.first_period_count }}期</span
                >
              </div>
            </el-col>
            <el-col :span="12">
              <div class="item">
                <span class="item-label">首贷金额：</span>
                <span class="item-value"
                  >{{ businessInfoData.first_loan_amount }}元</span
                >
              </div>
              <div class="item">
                <span class="item-label">是否结清：</span>
                <span class="item-value">{{
                  ~~businessInfoData.first_loan_finished ? '是' : '否'
                }}</span>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="row">
        <span class="fl row-label">续贷</span>
        <div class="row-value">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="item">
                <span class="item-label">最近续贷日期：</span>
                <span class="item-value">{{
                  businessInfoData.reloan_date
                }}</span>
              </div>
              <div class="item">
                <span class="item-label">最近续贷期数：</span>
                <span class="item-value"
                  >{{ businessInfoData.reloan_period_count }}期</span
                >
              </div>
            </el-col>
            <el-col :span="12">
              <div class="item">
                <span class="item-label">最近续贷金额：</span>
                <span class="item-value"
                  >{{ businessInfoData.reloan_amount }}元</span
                >
              </div>
              <div class="item">
                <span class="item-label">是否结清：</span>
                <span class="item-value">{{
                  ~~businessInfoData.reloan_finished ? '是' : '否'
                }}</span>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="row">
        <span class="fl row-label">逾欠</span>
        <div class="row-value">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="item">
                <span class="item-label">逾欠日期：</span>
                <span class="item-value">{{
                  businessInfoData.overdue_date
                }}</span>
              </div>
              <div class="item">
                <span class="item-label">逾欠期数：</span>
                <span class="item-value"
                  >{{ businessInfoData.overdue_repay_count }}期</span
                >
              </div>
              <div class="item">
                <span class="item-label">逾欠笔数：</span>
                <span class="item-value"
                  >{{ businessInfoData.overdue_asset_total }}笔</span
                >
              </div>
            </el-col>
            <el-col :span="12">
              <div class="item">
                <span class="item-label">逾欠金额：</span>
                <span class="item-value"
                  >{{ businessInfoData.overdue_total }}元</span
                >
              </div>
              <div class="item">
                <span class="item-label">逾欠天数：</span>
                <span class="item-value"
                  >{{ businessInfoData.overdue_days }}天</span
                >
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// import { formatTime, shortcutsOptions } from 'utils'
import TitleContainer from '@/components/title/TitleContainer.vue'

export default {
  name: 'activityInfo',
  data() {
    return {
      businessInfoData: {},
      tableData: [],
      activeName: 'first',
      tableLoading: true
    }
  },
  mounted() {
    this.getBusinessInfo()
  },
  components: {
    TitleContainer
  },
  methods: {
    //获取运营信息
    getBusinessInfo() {
      this.tableLoading = true
      this.$api.userReport.info
        .businessInfo({
          params: {
            id: this.$route.query.uid,
            apply_code: this.$route.query.apply_code
          }
        })
        .then(response => {
          this.businessInfoData = response.data.data
          // console.log(this.businessInfoData);
          this.tableLoading = false
        })
        .catch(error => {
          this.tableLoading = false
          this.$message.error(error)
        })
    }
  }
}
</script>

<style scoped>
.h3title {
  font-size: 18px;
  line-height: 36px;
  /*border-bottom: 1px solid #f1f1f1;*/
  /*font-weight: normal;*/
  margin-bottom: 20px;
}
.mb20 {
  margin-bottom: 20px;
}
.user-head img {
  display: block;
  width: 110px;
  height: 130px;
  margin: 0;
  border: 1px solid #ddd;
}
.user-head p {
  width: 110px;
  font-size: 14px;
  text-align: center;
  padding: 0;
  margin: 0;
  line-height: 30px;
}
.item {
  font-size: 14px;
  color: #555;
  margin: 12px 0;
  overflow: hidden;
}
.item-label {
  width: 130px;
  float: left;
  display: inline-block;
  line-height: 24px;
  text-align: right;
}
.item-value {
  float: left;
  display: inline-block;
  line-height: 24px;
  padding-left: 10px;
  color: #999;
}
.userInfo-container {
  border-top: 1px solid #e8e8e8;
  font-size: 14px;
  overflow: hidden;
}
.row {
  padding: 0;
  border: 1px solid #e8e8e8;
  border-top: none;
  overflow: hidden;
  background-color: #fafafa;
}
.row-label {
  width: 90px;
  line-height: 84px;
  padding-left: 20px;
  font-weight: 700;
  color: #555;
}
.row-value {
  padding: 15px 20px;
  border-left: 1px solid #e8e8e8;
  margin-left: 110px;
  background-color: #fff;
}
.table-container {
  margin-bottom: 20px;
}
</style>
